
import { request } from '@/utils/request';

import { BaseModel } from '@/api/common/baseModel'

export interface Model extends BaseModel {
  dataScope: number
  createTime: Date
}

// 查询列表
export const getPage = (params: any) => {
  return request.get({ url: '/staff/web/userCenter/auth/role/page.json', params })
}

// 查询详情
export const getById = (id: string) => {
  return request.get({ url: '/staff/web/userCenter/auth/role/getById.json?id=' + id })
}

// 修改
export const update = (data: any,) => {
  return request.put({ url: '/staff/web/userCenter/auth/role/update.json', data })
}

// 删除
export const del = (id: string) => {

  return request.post({
    url: '/staff/web/userCenter/auth/role/del.json',
    data: [id, ]
  })
}

// 用户密码重 置
export const resetRolePwd = (id: string, password: string) => {
  const data = {
    id,
    password
  }
  return request.put({ url: '/staff/web/userCenter/auth/role/update-password', data: data })
}

// 获取用户精简信息列表
export const getList = (): Promise<Model[]> => {
  return request.get({ url: '/staff/web/userCenter/auth/role/page.json?pageSize=0', })
}
